home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / scripts / makedist < prev    next >
Text File  |  1997-01-16  |  1KB  |  61 lines

  1. #!/bin/sh
  2. #
  3. # $0 <which>
  4. #
  5.  
  6. # Check parameters
  7. if [ "x$1" = "x" -o "x$2" = "x" ]; then
  8.     echo "Usage: $0 <which> <archive>"
  9.     echo "For example: $0 src AROS-1.10"
  10.     exit 1
  11. fi
  12.  
  13. # Find the name of the directory I'm in
  14. cdn=`pwd | sed 's:/.*/::'`
  15.  
  16. # Basename of the archive
  17. archive="$cdn/dist/$2"
  18.  
  19. # Move up one level
  20. cd ..
  21.  
  22. # Find the names of the files which contain the names of the files
  23. # to distribute
  24. distfiles=`find $cdn -name dist.$1 -print`
  25.  
  26. # Name of the file with the resulting list of all files to distribute
  27. filenames=/tmp/fn.$$
  28.  
  29. # Empty list
  30. rm -f $filenames
  31. touch $filenames
  32.  
  33. # For each file with a list of files...
  34. for dist in $distfiles ; do
  35.     # Get the base directory
  36.     dir=`dirname $dist`
  37.  
  38.     # Show where we are
  39.     echo "$dir"
  40.  
  41.     # Now read the list of files one by one
  42.     cat $dist | while read line ; do
  43.     # Replace patterns
  44.     ls $dir/$line >> $filenames
  45.     done
  46. done
  47.  
  48. # Sort the names
  49. sort $filenames > $filenames.srt
  50.  
  51. # Create compressed tar archive
  52. rm -f $archive.tgz
  53. tar -cvvz --files-from=$filenames.srt -f "$archive.tgz"
  54.  
  55. # Create LhA archive
  56. rm -f $archive.lha
  57. lha a "$archive.lha" `cat $filenames.srt`
  58.  
  59. # Remove list of filenames
  60. rm -f $filenames $filenames.srt
  61.